#include "../includes/OTHER_TYPES/ARRAY/CHAR/SHIFT_JIS.h"

int main(int argc, char * argv[])
{  
  CHECK_SYS_ENDIAN();
  
  // https://en.wikipedia.org/wiki/Shift_JIS
  
  // array encoded characters
  char real[20] = {'b', 'a', 0xC2, 0xA3, '>', 0x81, 0x89, 0x9A, 0xB3, 0xE2, 0x82, 0xAC, 0xA5, 0x7E, 0x8D, 0x88};
  for (int i = 0; i < 20; /**/)
  {
    print_enc_sjis(&real[0] + i, 20 - i);
    printf(" ");
    if (check_enc_sjis(&real[0] + i, 20 - i) == 0)
      break;
    i += check_enc_sjis(&real[0] + i, 20 - i);
  }
  
  // testing write_enc_sjis()
  sjis_int test = 0x5C;
  printf("\n%02X %02X\n", 0xC2, ((byte *) write_enc_sjis(test, &real[0], 20))[0]);
  print_enc_sjis(&real[0], 20);
  printf("\n");
  
  // testing the unicode funcs
  print_unicd_int(get_sjis_as_unicd(0x5C));
  printf("\n");
  print_sjis_int(get_unicd_as_sjis(0x7199));
  printf("\n");
  print_sjis_int(get_unicd_as_sjis(0x68D4));
  printf("\n");
  
  return 0;
}
